<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
        <ul id="ul1">
            <li>aaa
                <ul>
                    <li>111</li>
                    <li>222</li>
                    <li>333</li>
                </ul>
            </li>
            <li>bbb</li>
        </ul>


        <script type="text/javascript">

            //获取ul标签元素
            var ulObj = document.getElementById("ul1");

            //需求一：获取ID为ul1的所有的子级
            var children = ulObj.children;  //获取到的是一个数组
            console.log(children)


            //需求二：获取ID为ul1下面第一个li的标签名和内容
            var tagName = children[0].tagName;
            console.log("标签名：" + tagName) //获取到的标签名为大写

            var liInnerHtml = children[0].innerHTML;

            console.log("内容：" + liInnerHtml)

        </script>

    </body>
</html>